/*
 * @(#)SetDeclare.java	 2012-2-24
 *
 * Copyright 2004-2012 WXXR Network Technology Co. Ltd. 
 * All rights reserved.
 * 
 * WXXR PROPRIETARY/CONFIDENTIAL.
 */

package com.ykdl.member.kid.set;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.ykdl.member.kid.R;
import com.ykdl.member.base.GlobalContext;
import com.ykdl.member.base.QLog;
import com.ykdl.member.constant.KidAction;
import com.ykdl.member.constant.KidConfig;
import com.ykdl.member.kid.gears.BaseScreen;
import com.ykdl.member.kid.util.AccessTokenKeeper;
/**
 * 
 * 免责申明的页面
 *
 * @see
 * @since 1.0
 */
public class SetDeclare extends BaseScreen {
	private static AccessTokenKeeper mTokenKeeper;
	private String url = null;
	private String comeFrom="";
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setTopTitle("免责声明", 0, R.drawable.back_bg, new OnClickListener() {
			@Override
			public void onClick(View v) {
				
				finish();
			}
		}, 0, 0, null, R.drawable.title_bg, false);
		setContent(R.layout.cardintrowebview_xml);
		mTokenKeeper = new AccessTokenKeeper(this);
		comeFrom=this.getIntent().getStringExtra("COMEFROM");
		inint();
	}
	
	private void inint() {
		findViewById(R.id.go_ss).setVisibility(View.GONE);
		if(comeFrom!=null && comeFrom.equals("PredateSetActivity")){
			url=KidConfig.DATE_CALCULATION+"?"+mTokenKeeper.getmAccessTokenTitle()+"="+mTokenKeeper.getmAccessToken();;
		    setTopNav("预产期计算方法");
		}else if(comeFrom!=null && comeFrom.equals("setting_aboutus")){
			url=KidConfig.ABOUT_US+"?"+mTokenKeeper.getmAccessTokenTitle()+"="+mTokenKeeper.getmAccessToken();
			 setTopNav("关于我们");
		}else{
			url=KidConfig.GET_DISCLAIMER+"?"+mTokenKeeper.getmAccessTokenTitle()+"="+mTokenKeeper.getmAccessToken();;
		}
		WebView webView =  (WebView)findViewById(R.id.webView);
		mTokenKeeper = new AccessTokenKeeper(this);
		webView.loadUrl(url);
	}
}
